import logging

from dac.aces import Aces
from model.TableFeild import TableFeild

a = Aces()
a.connect("root", "123456abc", "120.76.56.158", 3306)
(a.use("gtest"))
# print(a.showdbs())
print(a.showtables())
# print(a.select("user", parm=["name"], order={"name": "desc"}, where={"name": "kilito1", "age": "10"}))
# print(a.selectByorder("s_user", "name", "password", id='asc'))
# a.createDb("tccc")
# f1 = TableFeild()
# f1.extra = 'asdf'
# f1.default = 1
# f1.field = 'age'
# f1.type = 'int'
# f2 = TableFeild()
# f2.extra = 'asdf'
# f2.default = "uname"
# f2.field = 'name'
# f2.type = 'varchar(50)'
# a.createTable('testable', [f1, f2])
# createTable = a.showCreateTable('testable')
# for ct in createTable:
#     for k in ct:
#         print(k + "-----------")
#         print(ct[k])
